package com.me.modules.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.me.modules.sys.dao.ValueDictionaryDao;
import com.me.modules.sys.entity.ValueDictionaryEntity;
import com.me.modules.sys.service.ValueDictionaryService;



@Service("valueDictionaryService")
public class ValueDictionaryServiceImpl implements ValueDictionaryService {


	@Autowired
	private ValueDictionaryDao valueDictionaryDao;

	@Override
	public ValueDictionaryEntity queryObject(Long id){
		return valueDictionaryDao.queryObject(id);
	}

	@Override
	public List<ValueDictionaryEntity> queryList(Map<String, Object> map){
		return valueDictionaryDao.queryList(map);
	}

    @Override
    public List<ValueDictionaryEntity> queryListByBean(ValueDictionaryEntity entity) {
        return valueDictionaryDao.queryListByBean(entity);
    }

	@Override
	public int queryTotal(Map<String, Object> map){
		return valueDictionaryDao.queryTotal(map);
	}

	@Override
	public int save(ValueDictionaryEntity valueDictionary){


		return valueDictionaryDao.save(valueDictionary);
	}

	@Override
	public int update(ValueDictionaryEntity valueDictionary){
        return valueDictionaryDao.update(valueDictionary);
	}

	@Override
	public int delete(Long id){
        return valueDictionaryDao.delete(id);
	}

	@Override
	public int deleteBatch(Long[] ids){
        return valueDictionaryDao.deleteBatch(ids);
	}


	@Override
	public ValueDictionaryEntity findByFieldIdAndUserId(Long fieldId, String tableId) {
		Map<String ,Object > map =new HashMap<String ,Object>();
		map.put("field_id",fieldId);
		map.put("table_id",tableId);
		return valueDictionaryDao.findByFieldIdAndUserId(map);
	}

}
